package com.auxgroup.smarthome.dto;

import com.auxgroup.smarthome.entity.MenuEntity;
import com.auxgroup.smarthome.basebean.MenuTypeEnum;

/**
 * Created by kevinchen on 2017/2/22.
 */
public class MenuDto {
    private String menuName;
    private String parentId;
    private MenuTypeEnum menuType;
    private String uri;
    private int sortNum;
    // 创建的时候 不需要该删除
    private String menuId;

    public MenuDto() {
    }

    public MenuDto(String menuName, MenuTypeEnum menuType, String parentId, String uri, int sortNum) {
        this.menuName = menuName;
        this.menuType = menuType;
        this.parentId = parentId;
        this.uri = uri;
        this.sortNum = sortNum;
    }

    public String getMenuName() {
        return menuName;
    }

    public void setMenuName(String menuName) {
        this.menuName = menuName;
    }

    public String getParentId() {
        return parentId;
    }

    public void setParentId(String parentId) {
        this.parentId = parentId;
    }

    public String getUri() {
        return uri;
    }

    public void setUri(String uri) {
        this.uri = uri;
    }

    public int getSortNum() {
        return sortNum;
    }

    public void setSortNum(int sortNum) {
        this.sortNum = sortNum;
    }

    public MenuTypeEnum getMenuType() {
        return menuType;
    }

    public void setMenuType(MenuTypeEnum menuType) {
        this.menuType = menuType;
    }

    public String getMenuId() {
        return menuId;
    }

    public void setMenuId(String menuId) {
        this.menuId = menuId;
    }

    public MenuEntity createMenuEntity(MenuEntity menuEntity){
        if (menuEntity==null)return null;
        menuEntity.setMenuName(this.menuName);
        menuEntity.setParentId(this.parentId);
        menuEntity.setMenuType(this.menuType);
        menuEntity.setLableKey(this.uri);
        menuEntity.setSortNum(this.sortNum);
        return menuEntity;
    }
}
